package com.sayai.work.tools.easyxml.demo;

import com.sayai.work.tools.easyxml.demo.bank.BankConfig;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;

@EnableConfigurationProperties
@SpringBootApplication
public class Xml2ExcelApplication {


    public static void main(String[] args) throws DocumentException {

        // 原生代码，启动会携带SpringLogo
//        SpringApplication.run(Xml2ExcelApplication.class, args);

        // 去掉自带的LOGO
        SpringApplication springApplication = new SpringApplication(Xml2ExcelApplication.class);
        springApplication.setBannerMode(Banner.Mode.OFF);
        springApplication.run(args);

        String filename = args != null && args.length > 0 ? args[0] : "doc/VAT.xml";
        Dom4jDemo d = new Dom4jDemo();
        d.setBank("BKM");
        d.getDocument(filename);

        System.out.println("Evrything is OK!");
    }

}
